<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<link href="css/businesscard.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="js/jquery-1.6.2.min.js"></script>
<script language="javascript" src="js/artDialog/artDialog.source.js?skin=blue"></script>
<script language="javascript" src="js/base.js"></script>
<script language="javascript" src="js/businesscard.js"></script>
</head>
<script type="text/javascript">
var loadingHtml = '<tr><td colspan=8 style="background:none;height:40px;text-align:center"><img src="images/base/loading.gif"/></td></tr>';
var noResultHtml = '<tr><td colspan=8 style="background:none;height:40px;text-align:center">暂无数据</td></tr>';
$(document).ready(function(){
	jQuery.event.remove(parent.$("#paginationDiv"));
	parent.$("*","#paginationDiv").die("click");
	parent.$("#paginationDiv").die("click");
	parent.$("#paginationDiv").harrypag({
		url:"business_card_ajax_list.do",
		data:{pageSize: 20, pageNo: 1},
		success:function(dataList){
			var objStr = "";
			var cl = "";
			$.each(dataList, function(i,data){
				if(i%2==1){cl="class='alt'"}else{cl=""}
				objStr=objStr+"<tr "+cl+"><td class='ckbox center'><input type=checkbox id='"+data.id+"'/></td>";
	     		objStr=objStr+"<td class='name'>"+(data.cardname==''?'&nbsp;':data.cardname)+"</td>";
	     		objStr=objStr+"<td class='mobilephone'>"+(data.mobilephone==''?'&nbsp;':data.mobilephone)+"</td>";
	     		objStr=objStr+"<td class='sex'>"+(data.sex==''?'&nbsp;':data.sex)+"</td>";
	     		objStr=objStr+"<td class='birthday'>"+(data.birthday==''?'&nbsp;':data.birthday)+"</td>";
	     		objStr=objStr+"<td class='mail'>"+(data.mail==''?'&nbsp;':data.mail)+"</td>";
	     		objStr=objStr+"<td>"+(data.address==''?'&nbsp;':data.address)+"</td>";
	     		objStr=objStr+"<td><a href='javascript:void(0)' class='abtn_edit_16' onclick='editCard("+data.id+")' title='编辑'></a><a href='javascript:void(0)' class='abtn_delete_16' onclick='deleteCardDir("+data.id+",\""+data.cardname+"\")' title='删除'></a></td>";
	     		objStr=objStr+"</tr>";
	     	});
	     	if(objStr == ""){objStr = noResultHtml}
			$("#datalistTbody").html(objStr);
		},
		ppIcon: [5,20,30,40,60],
		searchBtn:$("#submitSearch"),  //searchBtn
		searchParam:{"searchitem": $("#searchitem"), "searchparam": $("#searchparam"),"cardgroup": $("#currentGroupId")}  //search params,{paramname, Element ID}
	});
	
	$("#submitSearch${info.srdm}").click(function(){
		$("#datalistTbody").html(loadingHtml);
	});
	$("#searchAllCard").click(function(){
		$("#datalistTbody").html(loadingHtml);
	});
	
	$("#searchAllCard").click(function(){
		$("#searchparam").val("");
		$("#submitSearch").click();
	});
	
});
</script>
<style>
</style>
<body>
<input type="hidden" id="currentGroupId" value="${info.currentGroupId}"/>
<table id="searchTable">
	<tr>
		<td width=70px><select id="searchitem"><option value="name">姓名</option><option value="mobilephone">手机</option></select></td>
		<td width=120px><input type="text" id="searchparam"/></td>
		<td width=70px class="center"><input type="button" id="submitSearch" class="liteBlueBtn" onclick="this.blur()" value="搜索"></td>
		<td width=70px class="center"><input type="button" id="searchAllCard" class="liteBlueBtn" onclick="this.blur()" value="全部"></td>
		<td></td>
	</tr>
</table>
<table id="cardTable" cellpadding="0" cellspacing="0">
	<thead id="datalistThead">
		<tr>
			<th class='ckbox'>&nbsp;</th>
			<th class='name'>姓名</th>
			<th class='mobilephone'>手机</th>
			<th class='sex'>性别</th>
			<th class='birthday'>生日</th>
			<th class='mail'>E-mail</th>
			<th>地址</th>
			<th class="operation center">操作</th>
		</tr>
	</thead>
	<tbody id="datalistTbody">
		<tr><td colspan=7 style="background:none;height:40px;text-align:center"><img src='images/base/loading.gif'/></td></tr>
	</tbody>
</table>
<div id="pagBox">
	<div id="paginationDiv"></div>
</div>
</body>
</html>